/* 1754. 构造字典序最大的合并字符串 */
/**
 * @param {string} word1
 * @param {string} word2
 * @return {string}
 */
/* 
    贪心

*/
var largestMerge = function (word1, word2) {
	let merge = ''
	let i = 0,
		j = 0
	while (i < word1.length || j < word2.length) {
		if (i < word1.length && word1.slice(i) > word2.slice(j)) {
			merge += word1[i]
			i++
		} else {
			merge += word2[j]
			j++
		}
	}

	return merge
}
